/*
 * Ant Group
 * Copyright (c) 2004-2024 All Rights Reserved.
 */
package com.alipay.zmdepositdemo.controller;

import com.alipay.api.response.AlipayDataDataserviceBillDownloadurlQueryResponse;
import com.alipay.zmdepositdemo.model.OpenResponse;
import com.alipay.zmdepositdemo.service.trade.TradeOrderService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 对账
 *
 * @author zhangjian
 * @version TradeBillController.java, v 0.1 2024年07月04日 14:31 zhangjian
 */
@Api(tags = "对账")
@ApiSupport(order = 8)
@RestController
@RequestMapping(value = "/trade-bill")
public class TradeBillController {

    @Autowired
    private TradeOrderService tradeOrderService;

    /**
     * 查询对账单下载地址
     *
     * @see <a
     * href="https://opendocs.alipay.com/open/759e0553_alipay.data.dataservice.bill.downloadurl.query?scene=common&pathHash=afc647cf">..
     * .</a>
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "查询对账单下载地址接口")
    @GetMapping(value = "/query-bill-download-url")
    OpenResponse<AlipayDataDataserviceBillDownloadurlQueryResponse> queryBillDownloadUrl(
            @ApiParam(value = "账单类型", defaultValue = "trade") @RequestParam(required = true) String billType,
            @ApiParam(value = "账单时间", defaultValue = "2016-04-05") @RequestParam(required = true) String billDate,
            @ApiParam(value = "二级商户smid", defaultValue = "2088123412341234") @RequestParam(required = false) String smId) {
        return tradeOrderService.queryBillDownloadUrl(billType, billDate, smId);
    }
}